#
# Předmět: ICP
# Projekt: Člověče, nezlob se!
# Autoři:  Petr Bušina, Zdeněk Coufal
# Datum:   8.5.2011
# 
# Použití:
#   - překlad:      make
#   - zabalit:      make pack
#   - vyčistit:     make clean
#		- spustit: 			make run, make runserver
#

HOSTNAME=$(shell hostname)
QMAKE=qmake

ifeq ($(HOSTNAME),merlin.fit.vutbr.cz)
	QMAKE=/usr/local/share/Qt-4.6.2/qt/bin/qmake
	QTDIR=/usr/local/share/Qt/qt/lib 
	QMAKESPEC=/usr/local/share/Qt/qt/mkspecs/linux-g++
endif 

XLOGINXX = xcoufa06

SERVER          = src/server2011
CLIENT          = src/hra2011

PACKFILES= src examples doc README.txt Makefile

all:
	$(QMAKE) -o src/Makefile src/server2011.pro
	make -C src
	rm src/Makefile
	$(QMAKE) -o src/Makefile src/hra2011.pro
	make -C src
	rm src/Makefile

.PHONY: pack clean run runserver doxygen

clean:
	rm -fr src/*.o $(SERVER) $(CLIENT)

pack:
	tar cvzf $(XLOGINXX).tar.gz $(PACKFILES)
	#zip $(XLOGINXX).zip $(PACKFILES)

run:
	./src/hra2011

runserver:
	./src/server2011 -p 30000

doxygen:
	doxygen src/doxconf 2>/dev/null


